const express = require("express");
const fs = require("fs");
const path = require("path");

let router = express.Router();

router.get("/getlist",function(req,res){
    try {
        let list = fs.readFileSync(path.join(__dirname,"../jsonData/quoList.json"));
        res.json(JSON.parse(list))
    } catch (error) {
        res.status(404).send(error);
    }
});

router.get("/getInfo",function(req,res){
    try {
        let list = fs.readFileSync(path.join(__dirname,"../jsonData/quoList.json"));
        res.json(JSON.parse(list)[0])
    } catch (error) {
        res.status(404).send(error);
    }
});

module.exports = router;